package com.kim.producers.controller;

import com.kim.producers.rabbitmq.DriverRabbitmqServce;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @Project: kim-rabbitmq-deadqueue
 * @PackageName: com.kim.producers.controller
 * @FileName: SendController.java
 * @Description: The SendController is...
 * @Author: kimwu
 * @Time: 2020-12-03 14:17:37
 */
@RestController
@RequestMapping("/rabbitmq")
public class SendController {

    @Autowired
    private DriverRabbitmqServce driverRabbitmqServce;

    @PostMapping("/send")
    public void send() {
        driverRabbitmqServce.sendDriverMessage(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + " 发送了普通消息");
    }

}
